<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  author: Jsonor
  date: 2018/3/20 15:53
  description: Description
--%>
<%@ page contentType="text/html;charset=UTF-8" isELIgnored="false" %>
<html>
<head>
  <title>城市信息</title>
  <style>
    #hid{
      margin: 10px auto;
      text-align: center;
    }
    #tbox{
      margin: 10px auto;
      text-align: center;
    }
    #tp{
      margin: 10px auto;
      text-align: center;
    }
  </style>
</head>
<body>
<h1 id="hid">城市信息</h1>
<%--搜索框:模糊查询--%>
<div style="text-align: center">
  <form action="${pageContext.request.contextPath}/sakura/findByCondition">
    <input type="text" name="condition" value="${condition}">
    <input type="submit"  value="搜索">
  </form>
</div>
<hr>
<%--添加--%>
<div id="tp"><a href="${pageContext.request.contextPath}/sakura/addUI">添加</a></div>
<%--列表--%>
<form action="" >
  <table border="1" cellspacing="0" width="800px" id="tbox">
    <tr>
      <td>id</td>
      <td>code</td>
      <td>name</td>
      <td>region</td>
      <td>surfaceArea</td>
      <td>indepYear</td>
      <td>population</td>
      <td>lifeExpectancy</td>
      <td>gNP</td>
      <td>headOfState</td>
      <td>capital</td>
      <td>code2</td>
      <td>function</td>
    </tr>
    <c:forEach items="${list}" var="c" varStatus="status">
      <tr>
        <td>${status.count}</td>
        <td>${c.code}</td>
        <td>${c.name}</td>
        <td>${c.region}</td>
        <td>${c.surfaceArea}</td>
        <td>${c.indepYear}</td>
        <td>${c.population}</td>
        <td>${c.lifeExpectancy}</td>
        <td>${c.gNP}</td>
        <td>${c.headOfState}</td>
        <td>${c.capital}</td>
        <td>${c.code2}</td>
        <td><a href="${pageContext.request.contextPath}/sakura/updateUI?code=${c.code}">修改</a>
          <a href="${pageContext.request.contextPath}/sakura/delete?code=${c.code}" onclick="return confirm('确认是否删除')">删除</a></td>
      </tr>
    </c:forEach>
  </table>
</form>
</body>
</html>
